﻿<Window x:Class="P2.Cuberry.Modules.SimpleSCM.SCSupplierInvoice.SCSupplierInvoiceItemsDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Height="389" Width="337"
        
        Icon="/P2.Cuberry;component/Images/CuberryIcon32.ico"
        Title="Peacequare Cuberry"              
        Background="{DynamicResource P2BackgroundBrush}" 
        Loaded="Window_Loaded"
        >
    
    <Window.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
    </Window.Resources>

    <Grid>
<Grid.Resources>
            <Image x:Key="SaveAndCloseIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleSCM.SCSupplierInvoice;component/Images/Cancel.png" />
            <Image x:Key="SaveAndNewIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleSCM.SCSupplierInvoice;component/Images/SaveAndNew.ico" />
            <Image x:Key="CancelIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleSCM.SCSupplierInvoice;component/Images/cancel.png" />

            <Image x:Key="BookIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleSCM.SCSupplierInvoice;component/Images/book16.gif" />
            <Image x:Key="CancelTransactionIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleSCM.SCSupplierInvoice;component/Images/cancelTransaction16.gif" />

            <Image x:Key="Printer2Icon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleSCM.SCSupplierInvoice;component/Images/printer2.png" />
            <Image x:Key="FindIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.SimpleSCM.SCSupplierInvoice;component/Images/find16.gif" />
    

        </Grid.Resources>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>

        <!-- Row 0 Start -->
        
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Margin="0,0,0,0" Content="Supplier Invoice Item" Style="{StaticResource P2DetailViewHeaderTextStyle}" />

        <Separator Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="0"/>
        <!-- Row 0 End -->

        <!-- Row 1: Menu Start -->
        <Border  Grid.Row="1" Grid.Column="0"  Style="{StaticResource P2MenuBorderStyle}">
            <Menu Grid.Row="1" x:Name="menuMain" Style="{StaticResource P2MenuStyle}" >
           
                <MenuItem x:Name="SaveBtn" InputGestureText="Ctrl+S" Header="{Translate SaveAndCloseBtn}" Command="{Binding SCSupplierInvoiceItemSaveCommand}" Icon="{StaticResource SaveAndCloseIcon}" Style="{StaticResource P2MenuItemStyle}" />
                <MenuItem x:Name="SaveAndNewBtn" InputGestureText="Ctrl+S" Header="{Translate SaveAndNewBtn}" Command="{Binding SCSupplierInvoiceItemSaveAndNewCommand}" Icon="{StaticResource SaveAndNewIcon}" Style="{StaticResource P2MenuItemStyle}" />

                <!--
                <MenuItem x:Name="CloseBtn" InputGestureText="Ctrl+X" Header="{Translate SaveAndCloseBtn}" Command="{Binding SCSupplierInvoiceItemCloseCommand}" Icon="{StaticResource CancelIcon}" Style="{StaticResource P2MenuItemStyle}"/>
 -->
            </Menu>
        </Border>
        <!-- Row 1 End -->
        <!-- Row 2: All Fields -->
        <Border  Grid.Row="2" Grid.Column="0"  Style="{StaticResource P2ContentBorderStyle}">
            <Grid >


                <Label HorizontalAlignment="Left" Margin="5,3,0,0" Name="ProductCodeL" Width="120" Height="28" VerticalAlignment="Top" Content="{Translate ProductCodeL}" ></Label>
                <TextBox  Margin="5,24,5,0" Name="ProductCode" Height="23" Width="120" Text="{Binding ProductCode, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  HorizontalAlignment="Left"  VerticalAlignment="Top" Style="{StaticResource P2TextBoxStyle}"/>
                <Button Margin="130,23,0,0" Height="23" Name="FindFiAccount" VerticalAlignment="Top" Width="23" Command="{Binding SCSupplierInvoiceItemFindCommand}" HorizontalAlignment="Left">
                <Image  Source="/P2.Cuberry.Modules.SimpleSCM.SCSupplierInvoice;component/Images/find16.gif"></Image>                    
                </Button>
                <Button Margin="155,23,0,0" Height="23" Name="RefreshFiAccount" VerticalAlignment="Top" Width="23" Command="{Binding SCProductRefreshCommand}" HorizontalAlignment="Left">
                    <Image  Source="/P2.Cuberry.Modules.SimpleSCM.SCSupplierInvoice;component/Images/Refresh.ico"></Image>
                </Button>
                <TextBox  Margin="5,51,6,0" Name="ProductName" Height="23" Text="{Binding ProductName, Mode=OneWay, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalAlignment="Top" Style="{StaticResource P2TextBoxStyle}" IsEnabled="False"/>
<!--
                <ComboBox  Margin="95,51,5,0" Name="ProductID" Width="250" HorizontalAlignment="Left"  SelectedValue="{Binding ProductID}" 
                           ItemsSource="{Binding AvailableProducts}"
                           IsReadOnly="True" SelectedValuePath="ProductID" DisplayMemberPath="ProductNameCur" Height="23" VerticalAlignment="Top" Style="{StaticResource P2ComboBoxStyle}" />
    -->
                <Label HorizontalAlignment="Left" Margin="5,81,0,0" Name="PositionL" Width="120" Content="{Translate PositionL}" Height="28" VerticalAlignment="Top" />
                <TextBox Margin="5,0,0,103" Name="Position" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" 
                         Text="{Binding Position , ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" 
                         Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}" HorizontalAlignment="Left" 
                         Width="140" Height="24" VerticalAlignment="Bottom" />
                <Label Content="{Translate ServiceChargeL}" Height="28" HorizontalAlignment="Left" Margin="5,0,0,70" Name="ServiceChargeL" VerticalAlignment="Bottom" Width="120" />
                <TextBox AcceptsReturn="True" HorizontalAlignment="Left" Margin="5,0,0,51" Name="ServiceCharge" Style="{StaticResource P2TextBoxStyle}" Text="{Binding ServiceCharge, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalScrollBarVisibility="Auto" Width="140" Height="24" VerticalAlignment="Bottom" />
                <Label Content="{Translate VATL}" Height="28" HorizontalAlignment="Left" Margin="153,0,0,70" Name="VATL" VerticalAlignment="Bottom" Width="120" />
                <TextBox AcceptsReturn="True" HorizontalAlignment="Left" Margin="153,0,0,51" Name="VATPercent" Style="{StaticResource P2TextBoxStyle}" Text="{Binding VATPercent, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalScrollBarVisibility="Auto" Width="140" Height="24" VerticalAlignment="Bottom" />


                <Label HorizontalAlignment="Left" Margin="153,0,0,122" Name="QuantityL" Width="120" Content="{Translate QuantityL}" Height="28" VerticalAlignment="Bottom" />
                <TextBox Margin="0,0,8,103" Name="Quantity" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" 
                         Text="{Binding Quantity, StringFormat=F2, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" 
                         Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}" HorizontalAlignment="Right" 
                         Width="140" Height="24" VerticalAlignment="Bottom" />

                <Label HorizontalAlignment="Left" Margin="5,0,0,23" Name="PricePerUnitL" Width="120" Content="{Translate PricePerUnitL}" Height="28" VerticalAlignment="Bottom"></Label>
                <TextBox  Margin="5,0,0,5" Name="PricePerUnit" Height="24" Width="140" Text="{Binding PricePerUnit, StringFormat=F2, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  HorizontalAlignment="Left"  VerticalAlignment="Bottom" Style="{StaticResource P2TextBoxStyle}" GotFocus="PricePerUnit_GotFocus" FlowDirection="LeftToRight"  TextAlignment="Right"/>

                <Label HorizontalAlignment="Left" Margin="153,0,0,23" Name="ExpiryDateL" Width="120" Content="{Translate ExpiryDateL}" Height="28" VerticalAlignment="Bottom" />
                <!--<TextBox Margin="153,0,0,5" Name="ExpiryDate" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" 
                         Text="{Binding ExpiryDate , ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" 
                         Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}" HorizontalAlignment="Left" 
                         Width="140" Height="24" VerticalAlignment="Bottom" />-->

                <DatePicker  Name="ExpiryDate"  
                            xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit" SelectedDate="{Binding ExpiryDate, Mode=TwoWay ,StringFormat=dd/MM/yyyy, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"  Height="23"  IsEnabled="{Binding NameEnabled}" Margin="153,203,3,5"></DatePicker>
                              
            </Grid>
        </Border>

    </Grid>
</Window>
